<?php if (isset($full_page) && $full_page): ?><?php include(FULL_HTML_VIEWS_PATH . "/common/page_header.php"); ?><?php if (isset($debug_page)): ?>
    <link href="bootstrap_ace/css/bootstrap.min.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">
<?php endif; ?><?php include(FULL_HTML_VIEWS_PATH . "/common/page_menu.php"); ?>
    <div class="main-content"><div class="main-content-inner"><div class="page-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <?php include(FULL_HTML_VIEWS_PATH . "/common/page_ur_here.php"); ?>
                </ul>
            </div>
        </div>
    </div><h2 class="sub-header">
        <?php echo $page_title ?>
        <?php if (check_privilege_view(221)): ?>
            <a data-dailogclass="modal-lg" href="<?php echo site_url($my_router . '/info/0'); ?>" class="btn btn-primary pull-right" style="margin-right: 8px;">添加人员</a>
        <?php endif; ?>
    </h2><div class="row"><div class="col-sm-12">
    <div class="panel panel-default">
        <form data-action="listSearchForm" class="navbar-form" action="" role="search" method="get">
            <div class="form-group">
                <span class="glyphicon glyphicon-search"></span>
                <input name="keywords" type="text" style="width: 250px;border-width:1px" class="form-control" placeholder="人员ID/人员姓名" value="">
            </div>
            <button type="submit" class="btn btn-primary btn-sm">搜索</button>
            <input type="reset" class="btn btn-warning btn-sm" value="重置"/>
            <?php if (empty($pager['filter']['trash'])): ?>
                <a href="<?php echo site_url("$my_router?trash=1"); ?>" class="pull-right btn btn-sm btn-warning"><span class="glyphicon glyphicon-trash"></span> 回收站(<span id="trash_count"><?php echo $trash_count ?></span>)</a>
            <?php else: ?>
                <a href="<?php echo site_url("$my_router"); ?>" class="pull-right btn btn-sm btn-info"><span class="glyphicon glyphicon-backward"></span> 返回列表</a>
            <?php endif; ?>
        </form>
    </div><div class="panel panel-default"><div id="tableList" class="table-responsive">
<?php endif;  //判断是否为ajax提交?>
    <form data-action="ajaxForm" action="<?php echo site_url("$my_router/batch") ?>" method="post">
        <table class="table table-striped table-hover text-center">
            <thead>
            <tr>
                <th width="60">
                    <input name="checkAll" onclick='listTable.selectAll(this)' type="checkbox"/><a href="javascript:;" onClick="listTable.sort(this);" ltb-sort="id">ID</a>
                </th>
                <th>人员基本信息</th>
                <th>人员头像</th>
                <th>日期信息</th>
                <th class="text-center">
                    <div class="ltb_dropdown">
                        <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">状态
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu" data-field="active">
                            <li><a href="javascript:;" data-value="0">全部</a></li>
                            <li class="divider"></li>
                            <li>
                                <a href="javascript:;" data-value="11"><span class="glyphicon glyphicon-ok"></span> 启用</a>
                            </li>
                            <li>
                                <a href="javascript:;" data-value="10"><span class="glyphicon glyphicon-ban-circle"></span> 停用</a>
                            </li>
                        </ul>
                    </div>
                </th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($lists as $item): ?>
                <tr id="helper_<?php echo $item['id'] ?>">
                    <td align="left" style="width: 80px;">
                        <input name="checkboxes[]" type="checkbox" value="<?php echo $item['id'] ?>"/><?php echo $item['id'] ?>
                    </td>
                    <td align="left" >
                        人员姓名:<?php echo $item['real_name'] ?>
                        <br/>人员手机: <?php echo $item['mobile'] ?>
                        <br/>人员性别: <?php echo $item['gender'] == 0 ? "保密" : ($item['gender'] == 1 ? "男" : "女") ?>
                        <br/>用户类型: <?php echo $item['is_web_admin_role'] == 1 ? '超级管理员' : '普通管理员' ?>
                        <!--<br/>所属角色: --><?php /*echo $item['role_name'] */?>
                    </td>
                    <td align="left">
                        <a href="<?php echo get_image_oss($item['avatar']); ?>" class="thumbnail" target="_blank" style="margin-bottom:0px;" rel='highslide'>
                            <img src="<?php echo get_image_oss($item['avatar']); ?>" onerror="this.src='<?php echo full_static_url('res/no_picture.png'); ?>'">
                        </a>
                    </td>
                    <td align="left">
                        注册日期: <?php echo date("Y-m-d H:i:s", $item['add_time']) ?>
                        <br/>最后登录时间: <?php echo date("Y-m-d H:i:s", $item['last_time']) ?>
                    </td>
                    <td>
                        <a  style="color:#090" class="btn btn-sm btn-success <?php echo($item['active'] > 0 ? '' : 'hide') ?>" <?php if (check_privilege_view(222) && $item['is_web_admin_role'] == 0): ?>data-action="toggleStatus" href="<?php echo site_url("$my_router/ajax/hide/" . $item['id']); ?>" data-toggle="tooltip" data-placement="right" title="点击禁用"<?php endif; ?>><span class="glyphicon glyphicon-ok"></span> 启用</a>
                        <a  style="color:#F00" class="btn text-primary btn-sm btn-default <?php echo($item['active'] > 0 ? 'hide' : '') ?>" <?php if (check_privilege_view(222) && $item['is_web_admin_role'] == 0): ?>data-action="toggleStatus" href="<?php echo site_url("$my_router/ajax/show/" . $item['id']); ?>"<?php endif; ?> data-toggle="tooltip" data-placement="right" title="点击启用"><span class="glyphicon glyphicon-ban-circle"></span> 禁用</a>
                    </td>
                    <td align="right">
                        <div class="btn-group">
                            <button class="btn btn-white  btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 功能操作
                                <span class="caret" style="border-top-color:#444444"></span>
                            </button>
                            <ul class="dropdown-menu" style="min-width:120px">
                                <?php if (check_privilege_view(222) && $item['is_web_admin_role'] == 0 || ($_SESSION['user_id'] == $item['id'])): ?>
                                    <li>
                                        <a href="<?php echo site_url("$my_router/info/" . $item['id']) ?>"><span class="glyphicon glyphicon-edit"></span> 编辑</a>
                                    </li>
                                <?php endif; ?>
                                <?php if (check_privilege_view(224) && $item['is_web_admin_role'] == 0 || ($_SESSION['user_id'] == $item['id'])): ?>
                                    <li>
                                        <a class="text-info" data-action="listRemove" data-href="<?php echo site_url("$my_router/ajax/respwd/" . $item['id']); ?>" data-target="#tableList" data-confirm="确定要重置为123456吗？" href="javascript:void(0);"><span class="glyphicon glyphicon-repeat"></span> 密码重置</a>
                                    </li>
                                <?php endif; ?>
                                <?php if (check_privilege_view(223) && $item['is_web_admin_role'] == 0): ?><?php if ($item['is_delete']): ?>
                                    <li>
                                        <a class="text-info" data-action="listRemove" data-href="<?php echo site_url("$my_router/ajax/restore/" . $item['id']); ?>" data-target="#tableList" data-confirm="确定要恢复吗？" href="javascript:void(0);"> 恢复</a>
                                    </li>
                                <?php else: ?>
                                    <li>
                                        <a data-action="listRemove" href="javascript:void(0)" data-href="<?php echo site_url("$my_router/ajax/delete/" . $item['id']); ?>" data-target="#tableList" data-confirm="确定要删除吗？"><span class="glyphicon glyphicon-trash"></span> 删除</a>
                                    </li>
                                <?php endif; ?><?php endif; ?>
                            </ul>
                        </div>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
            <tfoot>
            <?php if ($lists): ?>
                <tr>
                    <td align="left"><label>
                            <input name="checkAll" onclick='listTable.selectAll(this)' type="checkbox"> 全选</label>
                    </td>
                    <td align="left" colspan="98">
                        <div class="btn-group dropup">
                            <a href="javascript:;" class="btn btn-white  btn-sm dropdown-toggle" data-toggle="dropdown">批量操作
                                <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <?php if (check_privilege_view(222)): ?>
                                    <li class="disabled">
                                        <a ltb-btn="batch" ltb-opt="show" title="批量启用"><span class="glyphicon glyphicon-ok"></span> 启用</a>
                                    </li>
                                    <li class="disabled">
                                        <a ltb-btn="batch" ltb-opt="hide" title="批量停用"><span class="glyphicon glyphicon-ban-circle"></span> 停用</a>
                                    </li>
                                <?php endif; ?>
                                <li class="divider"></li>
                                <?php if (check_privilege_view(223)): ?><?php if (empty($pager['filter']['trash'])): ?>
                                    <li class="disabled">
                                        <a ltb-btn="batch" ltb-opt="delete" title="批量删除"><span class="glyphicon glyphicon-trash"></span> 删除</a>
                                    </li>
                                <?php else: ?>
                                    <li class="disabled">
                                        <a ltb-btn="batch" ltb-opt="restore" title="批量恢复"><span class="glyphicon glyphicon-retweet"></span> 恢复</a>
                                    </li>
                                <?php endif; ?><?php endif; ?>
                            </ul>
                        </div>
                        <input type="hidden" name="action" value=""></td>
                </tr>
            <?php else: ?>
                <tr>
                    <td colspan="99">没有符合条件的数据……</td>
                </tr>
            <?php endif; ?>
            </tfoot>
        </table>
    </form><!--pagination start-->
<?php include(FULL_HTML_VIEWS_PATH . '/common/page_pager.php'); ?>
    <!--pagination end-->
<?php if (isset($full_page) && $full_page): //判断是否为ajax提交       ?>
    </div>

    </div></div></div></div></div></div></div><!-- /.main-content --><!--main row-->
    <div class="center-block" style="height:30px;"></div></div>
    <?php include(FULL_HTML_VIEWS_PATH . '/common/page_script.html'); ?><?php include(FULL_HTML_VIEWS_PATH . '/common/page_footer.php'); ?><?php endif;  //判断是否为ajax提交?>